const data = require("./mock/index.ts")
module.exports = {
    devServer: {
        before(app) {
            app.post("/api/list", (req, res) => {
                res.send({
                    code: 200,
                    data
                })
            })
            app.post('/api/detail', (req, res) => {
                const { id } = req.body;
                tabs.forEach(item => {
                    let o = item.find(item => item.id === id)
                    if (o) {
                        res.send({
                            code: 200,
                            data: o
                        })
                    }
                })
            })
        }
    }
}